﻿<UserControl x:Class="WPFExcelReport.YREQBOOK"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"                     
                    FontSize="16"
>
    <UserControl.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:Divideby10000  x:Key="d10000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <CollectionViewSource   x:Key="vwYGAAUF" Source="{Binding Path=SetEnv.GAAUF}" />
        <CollectionViewSource   x:Key="vwYARNA" Source="{Binding Path=SetStock.GAAUF}" />
        <CollectionViewSource   x:Key="vwGAAUF" Source="{Binding Path=SetDetail.GAAUF}" />
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="200"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Grid.ColumnSpan="3">
            <WrapPanel>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <WrapPanel Name="ZoneOrder">
                        <TextBlock Width="Auto">生产单:</TextBlock>
                        <TextBox   Name="txtAUFKRS" MaxLength="2" Width="40" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink"  CharacterCasing="Upper" TabIndex="11" />
                        <TextBox   Name="txtAUFLFD" MaxLength="6" Width="80" Margin="0,0,0,0"  HorizontalAlignment="Left" KeyUp="txtAUFLFD_KeyUp" />
                        <TextBox   Name="txtAUFPOS" MaxLength="6" Width="40" Margin="0,0,0,0"  HorizontalAlignment="Left" />
                        <Button  Height="30"  Width="30" Margin="10,0,0,0" Name="btnQuery" Click="btnQuery_Click" KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="13">
                            <Button.Background>
                                <ImageBrush ImageSource="Images/Search.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock FontSize="18"    Width="Auto"  Margin="0,0,0,0" Text="查询" />
                    </WrapPanel>
                    <Button Grid.Column="0" FontSize="18" Width="30" Height="30" Margin="20,0,0,0"   Click="btnListMUReq_Click">
                        <Button.Background>
                            <ImageBrush ImageSource="Images/Refresh.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Grid.Column="1"  Background="White"   Height="Auto"    Width="Auto"   Margin="0,0,0,0" Text="所有需求"   VerticalAlignment="Center"/>
                </Grid>
                <Grid Margin="20,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0"   Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="色毛条单"  VerticalAlignment="Center" />
                    <TextBox Grid.Column="1" Background="White" Height="Auto"    Width="60"   Margin="0,0,0,0" Name="txtKRSs" Text="HM;"   VerticalAlignment="Center"/>
                </Grid>
                <TextBlock FontSize="18" VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=原料}}"></TextBlock>
                <TextBox FontSize="18" Name="txtART" VerticalAlignment="Center" Width="200"></TextBox>
                <TextBlock FontSize="18" VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=色号}}"></TextBlock>
                <TextBox FontSize="18" Name="txtFARBE" VerticalAlignment="Center" Width="100"></TextBox>
                <Button Width="Auto"  FontSize="18"  Margin="10,0,0,0"  HorizontalAlignment="Left" Click="btnFilter_Click"  Content="{Binding Source={Localization:TranslateExtension Word=过滤}}"></Button>
                <Button Width="Auto"   FontSize="18"  Margin="10,0,0,0" HorizontalAlignment="Left" Click="btnFilterClear_Click" Content="{Binding Source={Localization:TranslateExtension Word=清除}}"></Button>
            </WrapPanel>
        </StackPanel>
        <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1*"></RowDefinition>
                </Grid.RowDefinitions>
                <WrapPanel Grid.Row="0">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="批次"  VerticalAlignment="Center" />
                        <TextBox Grid.Column="1" Background="White"  Text="{Binding Path=GABEM,Converter={StaticResource ResourceKey=gb2312},  Source={StaticResource ResourceKey=vwGAAUF}}"  Height="Auto"    Width="100"     Margin="15,0,0,0"   VerticalAlignment="Center"/>
                    </Grid>
                    <Button Grid.Column="0" FontSize="18" Width="30" Height="30" Margin="0,0,0,0"   Click="btnSaveGAAUF_Click">
                        <Button.Background>
                            <ImageBrush ImageSource="Images/save.png" />
                        </Button.Background>
                    </Button>
                </WrapPanel>
                <DataGrid  Grid.Row="1" 
                              FontSize="12"
                                   MaxHeight="200"
                                   CanUserReorderColumns="True"  
                                  CanUserResizeRows="True" 
                                   CanUserSortColumns="True"                  
                                   AutoGenerateColumns="False"    
                                   RowDetailsVisibilityMode="VisibleWhenSelected"  
                                   IsSynchronizedWithCurrentItem="True"  
                                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwGAAUF}}">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="" Binding="{Binding GAAUFKRS}" Width="Auto"/>
                        <DataGridTextColumn Header="生产单" Binding="{Binding GAAUFLFD}" Width="Auto"/>
                        <DataGridTextColumn Header="" Binding="{Binding GAAUFPOS}" Width="Auto"/>
                        <DataGridTextColumn Header="类型" Binding="{Binding GAAUFMSL}" Width="Auto"/>
                        <DataGridTextColumn Header="品种" Binding="{Binding GAART}" Width="Auto"/>
                        <DataGridTextColumn Header="版本" Binding="{Binding GAURVAR}" Width="Auto"/>
                        <DataGridTextColumn Header="色号" Binding="{Binding GAFARBE,Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                        <DataGridTextColumn Header="批次" Binding="{Binding GABEM,Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                        <DataGridTextColumn Header="需求" Binding="{Binding Path=GAKG1, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                        <DataGridTextColumn Header="预留" Binding="{Binding Path=GAKG2, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                        <DataGridTextColumn Header="留位" Binding="{Binding Path=GAKG3, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                        <DataGridTextColumn Header="已接收" Binding="{Binding Path=GAKG5, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                        <DataGridTextColumn Header="差异" Binding="{Binding Path=GAKG0, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                        <DataGridTextColumn Header="开始" Binding="{Binding GADATBIS}" Width="Auto"/>
                    </DataGrid.Columns>
                </DataGrid  >
            </Grid>
        </StackPanel>
        <DataGrid Grid.Row="2" Grid.Column="0" Margin="0,1,0,0"  
                              FontSize="12"
                              CanUserReorderColumns="True"  
                              CanUserResizeRows="True" CanUserSortColumns="True"                  
                              AutoGenerateColumns="False"   
                              EnableRowVirtualization="True"  
                              RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                              IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                          Name="dlgMGAAUF"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwYGAAUF}}"   
                              >
            <DataGrid.Columns>
                <DataGridTextColumn Header="类型" Binding="{Binding GAAUFMSL}" Width="Auto"/>
                <DataGridTextColumn Header="品种" Binding="{Binding GAART}" Width="Auto"/>
                <DataGridTextColumn Header="版本" Binding="{Binding GAURVAR}" Width="Auto"/>
                <DataGridTextColumn Header="色号" Binding="{Binding GAFARBE,Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                <DataGridTextColumn Header="需求" Binding="{Binding Path=GAKG1, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                <DataGridTextColumn Header="预留" Binding="{Binding Path=GAKG2, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                <DataGridTextColumn Header="留位" Binding="{Binding Path=GAKG3, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                <DataGridTextColumn Header="已接收" Binding="{Binding Path=GAKG5, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                <DataGridTextColumn Header="差异" Binding="{Binding Path=GAKG0, Converter={StaticResource ResourceKey=d100}}" Width="Auto"/>
                <DataGridTextColumn Header="开始" Binding="{Binding GADATBIS}" Width="Auto"/>
            </DataGrid.Columns>
        </DataGrid  >
        <StackPanel Grid.Row="2" Grid.Column="1" >
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1*"></RowDefinition>
                </Grid.RowDefinitions>
                <WrapPanel Grid.Row="0">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="库存"  VerticalAlignment="Center" />
                    </Grid>
                </WrapPanel>
                <DataGrid  Grid.Row="1" 
                              FontSize="12" 
                              CanUserReorderColumns="True"  
                              CanUserResizeRows="True" CanUserSortColumns="True"                  
                              AutoGenerateColumns="False"   
                              EnableRowVirtualization="True"  
                              RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Top"
                              IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                                   Name="dlgYARNA"
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwYARNA}}"   >
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="色号" Binding="{Binding GAFARBE,Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                        <DataGridTextColumn Header="纺批" Binding="{Binding GPSPPART,Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                        <DataGridTextColumn Header="染批" Binding="{Binding GPFBPART,Converter={StaticResource ResourceKey=gb2312}}" Width="Auto"/>
                        <DataGridTextColumn Header="类型" Binding="{Binding GLAUFMSL}" Width="Auto"/>
                        <DataGridTextColumn Header="库" Binding="{Binding LO}" Width="Auto"/>
                        <DataGridTextColumn Header="区" Binding="{Binding LB}" Width="Auto"/>
                        <DataGridTextColumn Header="库存" Binding="{Binding Path=NETKG}" Width="Auto"/>
                        <DataGridTextColumn Header="留位" Binding="{Binding Path=QLOCK}" Width="Auto"/>
                        <DataGridTextColumn Header="预扣" Binding="{Binding Path=QPLAN}" Width="Auto"/>
                        <DataGridTextColumn Header="自由" Binding="{Binding Path=QFREE}" Width="Auto"/>
                    </DataGrid.Columns>
                </DataGrid  >
            </Grid>
        </StackPanel>
    </Grid>
</UserControl>
